#!/usr/bin/python


from numpy import log, sqrt, exp

class tpl_kernel(object):
    '''Thin-plate spline kernel.'''

    @staticmethod
    def __call__(x):
        return x * x * log(x)

class gauss_kernel(object):
    '''Gaussian kernel.'''

    __dict__ = ('_beta',)

    def __init__(self, b):
        self._beta = n

    def __call__(self, x):
        arg = x / self._beta
        return exp(-arg * arg)

class multiquadric_kernel(object):
    '''Multiquadric kernel.'''

    __dict__ = ('_beta2',)

    def __init__(self, b):
        self._beta2 = b * b

    def __call__(self, x):
        return sqrt(x * x + self._beta2)

class imultiquadric_kernel(object):
    '''Inverse mutiquadric kernel.'''

    __dict__ = ('_beta2',)

    def __init__(self, b):
        self._beta2 = b * b

    def __call__(self, x):
        return 1.0 / sqrt(x * x + self._beta2)


def approximator(data, kernel):
    def f(x):
        return x



if __name__ == '__main__':

    t = tpl_kernel()
    print t(25), 25 * 25 * log(25)
